<?php 

function kirki_logo()
{
Kirki::add_section( 'logo', array(
    'priority'    => 10,
    'title'       => esc_html__( 'Logo徽标', 'ifan_theme' ),
	'panel'       => 'options',
) );

	// 主LOGO
Kirki::add_field( 'ifan-theme-config', [
	'type'        => 'image',
	'settings'    => 'biglogo_img_url',
	'label'       => esc_html__( '网站LOGO (URL)', 'ifan_theme' ),

	'section'     => 'logo',
	'default'     => get_template_directory_uri().'/style/images/logo1.png',
	'priority' => 1,
	'partial_refresh'    => [
		'biglogo_img_url' => [
			'selector'        => '.head_top_logo',
			'render_callback' => function() {
				// return Kirki::get_option('biglogo_img_url');
				return '<img src="'.Kirki::get_option('biglogo_img_url').'" alt="'.bloginfo('name').'" class="haed_logo1"><img src="'.Kirki::get_option('darklogo_img_url').'" alt="'.bloginfo('name').'" class="haed_logo2">';
			},
		],

	],
	
] );
Kirki::add_field( 'darklogo_img_url', [
	'type'        => 'image',
	'settings'    => 'darklogo_img_url',
	'label'       => esc_html__( '网站暗色LOGO (URL)', 'ifan_theme' ),

	'section'     => 'logo',
	'default'     => '',
	'priority' => 2,

] );
Kirki::add_field( 'smalllogo_img_url', [
	'type'        => 'image',
	'settings'    => 'smalllogo_img_url',
	'label'       => esc_html__( '网站小LOGO (URL)', 'ifan_theme' ),

	'section'     => 'logo',
	'default'     => '',
	'priority' => 3,
	'partial_refresh'    => [
		'header_site_title' => [
			'selector'        => '.site-title a',
			'render_callback' => function() {
				return get_bloginfo( 'name', 'display' );
			},
		],
		'document_title' => [
			'selector'        => 'head > title',
			'render_callback' => 'wp_get_document_title',
		],
	],
] );
Kirki::add_field( 'favicon_img_url', [
	'type'        => 'image',
	'settings'    => 'favicon_img_url',
	'label'       => esc_html__( '网站favicon图标 (URL)', 'ifan_theme' ),

	'section'     => 'logo',
	'default'     => '',
	'priority' => 4,

] );
}

 ?>